using System;
using System.Collections.Generic;
using System.Text;

namespace SWAS.Web.UI.Controls
{
    [Serializable]
    public class CustomValueCollection
    {
        private List<string> values;
        private List<string> keys;

        public CustomValueCollection()
        {
            values = new List<string>();
            keys = new List<string>();
        }

        public void Add(string key, string value)
        {
            if (!keys.Contains(key))
            {
                keys.Add(key);
                values.Add(value);
            }
            else
            {
                values[keys.IndexOf(key)] = value;
            }
        }

        public void Remove(string key)
        {
            if (keys.Contains(key))
            {
                values.RemoveAt(keys.IndexOf(key));
                keys.Remove(key);
            }
        }

        public string this[int index]
        {
            get { return values[index]; }
        }

        public string this[string key]
        {
            get { return values[keys.IndexOf(key)]; }
        }    


    }
}
